home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / chat / colirc.pat / colirc.patch
Encoding:
Text File  |  1995-12-19  |  25.6 KB  |  858 lines

  1. diff --unified --recursive --new-file ./Makefile.in ../colirc/Makefile.in
  2. --- ./Makefile.in    Wed Jan  4 22:40:23 1995
  3. +++ ../colirc/Makefile.in    Sun Dec 17 14:51:53 1995
  4. @@ -27,7 +27,7 @@
  5.  
  6.  # Where the ircII binary will be installed.
  7.  # 'make install' will compile and install the program
  8. -INSTALL_IRC = $(bindir)/irc
  9. +INSTALL_IRC = $(bindir)/colirc
  10.  
  11.  # Where the ircII library will be.  Generally this is the place that
  12.  # you put the scripts, help pages and translation tables.  It is
  13. @@ -181,7 +181,7 @@
  14.  installbin: installirc installserv installflush installwserv
  15.  
  16.  installirc: irc installdirs
  17. -    $(INSTALL) source/irc $(INSTALL_IRC)-$(VERSION)
  18. +    $(INSTALL) source/colirc $(INSTALL_IRC)-$(VERSION)
  19.      @if test -f $(INSTALL_IRC).old; then $(RM) $(INSTALL_IRC).old; fi
  20.      @if test -f $(INSTALL_IRC); then $(MV) $(INSTALL_IRC) $(INSTALL_IRC).old; fi
  21.      $(RM) $(INSTALL_IRC)
  22. diff --unified --recursive --new-file ./README.colirc ../colirc/README.colirc
  23. --- ./README.colirc    Wed Dec 31 16:00:00 1969
  24. +++ ../colirc/README.colirc    Sun Dec 17 17:52:16 1995
  25. @@ -0,0 +1,28 @@
  26. +colirc patch 0.11 <ircii 2.8.2>
  27. +bitching and whatnot goes to escrafrd@oz.net <MadHacker on LinuxNet>
  28. +
  29. +/color to change color of nicks
  30. +/set colorline on to turn on full line color <default off>
  31. +/rcolor to set colors picked to colorise nicks
  32. +
  33. +_USAGE_
  34. +
  35. +colors: black red green brown blue purple cyan white
  36. +for bright colors prefix b to the color <bred for bright red, etc>
  37. +
  38. +/color nick color
  39. +/rcolor +color or -color <-all and +all can be used>
  40. +/rcolor can accept multiple args </rcolor -all +red +green +blue>
  41. +
  42. +notes...
  43. +
  44. +if a nick does not have a color set to it<with /color> then it will have one
  45. +assigned to it based on the first two chars of the nick. the colors assigned
  46. +can be picked with /rcolor. default is all colors except black.
  47. +
  48. +if you have colorline set on, the whole line said by a person will be the
  49. +color of thier nick.
  50. +
  51. +you can change the color of channels if you are in multiple channels at
  52. +once. </set #channel green>
  53. +
  54. diff --unified --recursive --new-file ./include/color.h ../colirc/include/color.h
  55. --- ./include/color.h    Wed Dec 31 16:00:00 1969
  56. +++ ../colirc/include/color.h    Sun Dec 17 14:51:53 1995
  57. @@ -0,0 +1,32 @@
  58. +#ifndef _COLOR_H_
  59. +#define _COLOR_H_
  60. +/* define colors as control chars */
  61. +#define BLACK           '\027'
  62. +#define RED             BLACK+1
  63. +#define GREEN           BLACK+2
  64. +#define BROWN           BLACK+3
  65. +#define BLUE            BLACK+4
  66. +#define PURPLE          BLACK+5
  67. +#define CYAN            BLACK+6
  68. +#define WHITE           BLACK+7
  69. +#define BRIGHT          '\025'
  70. +
  71. +#define SAY_COLOR BLUE
  72. +
  73. +#ifndef TRUE
  74. +#define TRUE 1
  75. +#endif
  76. +
  77. +typedef struct _name_color  
  78. +{
  79. +        char *name;
  80. +        char colorstr[5];
  81. +        struct _name_color *next;
  82. +} name_color;
  83. +
  84. +extern  void    colorcmd _((char *, char *, char *));
  85. +extern  void    rcolorcmd _((char *, char *, char *));
  86. +char *color_of();
  87. +name_color *find_nc_name();
  88. +char *tolower_str();
  89. +#endif /* _COLOR_H_ */
  90. diff --unified --recursive --new-file ./include/config.h ../colirc/include/config.h
  91. --- ./include/config.h    Fri Jan 20 17:36:03 1995
  92. +++ ../colirc/include/config.h    Sun Dec 17 17:50:39 1995
  93. @@ -152,6 +152,7 @@
  94.  #define DEFAULT_CLOCK_24HOUR 1
  95.  #define DEFAULT_CLOCK_ALARM NULL
  96.  #define DEFAULT_CMDCHARS "/"
  97. +#define DEFAULT_COLORLINE 0
  98.  #define DEFAULT_COMMAND_MODE 0
  99.  #define DEFAULT_CONTINUED_LINE "  "
  100.  #define DEFAULT_DCC_BLOCK_SIZE 512
  101. diff --unified --recursive --new-file ./include/config.h.dist ../colirc/include/config.h.dist
  102. --- ./include/config.h.dist    Mon Oct 17 04:58:26 1994
  103. +++ ../colirc/include/config.h.dist    Sun Dec 17 14:51:53 1995
  104. @@ -23,7 +23,7 @@
  105.   * to your nearest servers.  However if you use a seperate 'ircII.servers'
  106.   * file and the ircII can find it, this setting is overridden.
  107.   */
  108. -#define DEFAULT_SERVER        "change.this.to.a.server"
  109. +#define DEFAULT_SERVER        "irc.cabi.net"
  110.  
  111.  /*
  112.   * Uncomment the following if the gecos field of your /etc/passwd has other
  113. @@ -153,6 +153,7 @@
  114.  #define DEFAULT_CLOCK_24HOUR 1
  115.  #define DEFAULT_CLOCK_ALARM NULL
  116.  #define DEFAULT_CMDCHARS "/"
  117. +#define DEFAULT_COLORLINE 0
  118.  #define DEFAULT_COMMAND_MODE 0
  119.  #define DEFAULT_CONTINUED_LINE "+"
  120.  #define DEFAULT_DCC_BLOCK_SIZE 512
  121. diff --unified --recursive --new-file ./include/irc.h ../colirc/include/irc.h
  122. --- ./include/irc.h    Mon Jan  2 05:31:40 1995
  123. +++ ../colirc/include/irc.h    Sun Dec 17 17:52:46 1995
  124. @@ -12,7 +12,7 @@
  125.  #ifndef __irc_h
  126.  #define __irc_h
  127.  
  128. -#define IRCII_COMMENT   "this is a bug free client.  honest"
  129. +#define IRCII_COMMENT   "colirc"
  130.  
  131.  #define IRCRC_NAME "/.ircrc"
  132.  
  133. diff --unified --recursive --new-file ./include/vars.h.proto ../colirc/include/vars.h.proto
  134. --- ./include/vars.h.proto    Fri Jan  6 07:23:36 1995
  135. +++ ../colirc/include/vars.h.proto    Sun Dec 17 14:51:53 1995
  136. @@ -50,6 +50,7 @@
  137.  #define CLOCK_24HOUR_VAR $
  138.  #define CLOCK_ALARM_VAR $
  139.  #define CMDCHARS_VAR $
  140. +#define COLORLINE_VAR $
  141.  #define COMMAND_MODE_VAR $
  142.  #define CONTINUED_LINE_VAR $
  143.  #define DCC_BLOCK_SIZE_VAR $
  144. diff --unified --recursive --new-file ./source/Makefile.in ../colirc/source/Makefile.in
  145. --- ./source/Makefile.in    Thu Dec 29 03:02:44 1994
  146. +++ ../colirc/source/Makefile.in    Sun Dec 17 15:40:20 1995
  147. @@ -15,14 +15,14 @@
  148.  LN    = @LN@
  149.  RM    = @RM@
  150.  
  151. -OBJECTS = alias.o crypt.o ctcp.o dcc.o debug.o edit.o exec.o flood.o\
  152. +OBJECTS = alias.o color.o crypt.o ctcp.o dcc.o debug.o edit.o exec.o flood.o\
  153.      funny.o help.o history.o hold.o hook.o if.o ignore.o input.o\
  154.      irc.o ircaux.o ircsig.o keys.o lastlog.o list.o log.o mail.o\
  155.      menu.o names.o newio.o notice.o notify.o numbers.o output.o\
  156.      parse.o queue.o reg.o scandir.o screen.o server.o stack.o\
  157.      status.o term.o translat.o vars.o whois.o window.o $(PP_OBJS)
  158.  
  159. -SOURCES = alias.c crypt.c ctcp.c dcc.c debug.o edit.c exec.c flood.c\
  160. +SOURCES = alias.c color.c crypt.c ctcp.c dcc.c debug.o edit.c exec.c flood.c\
  161.      funny.c help.c history.c hold.c hook.c if.c ignore.c input.c\
  162.      irc.c ircaux.c ircsig.c keys.c lastlog.c list.c log.c mail.c\
  163.      menu.c names.c newio.c notice.c notify.c numbers.c output.c\
  164. @@ -42,7 +42,7 @@
  165.  default:
  166.      (cd ..;make)
  167.  
  168. -all: irc
  169. +all: colirc
  170.  
  171.  # got I hate typos.
  172.  clena: clean
  173. @@ -50,12 +50,12 @@
  174.  .c.o:
  175.      $(CC) $(CFLAGS) $(DEFS) $(PP_DEFS) $(INCLUDES) -c $<
  176.  
  177. -irc: $(OBJECTS)
  178. -    $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -o irc $(OBJECTS) $(LIBS)
  179. +colirc: $(OBJECTS)
  180. +    $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -o colirc $(OBJECTS) $(LIBS)
  181.  clean::
  182. -    $(RM) irc $(OBJECTS)
  183. +    $(RM) colirc $(OBJECTS)
  184.  
  185. -install: irc
  186. +install: colirc
  187.      cd ..; $(MAKE) install
  188.  
  189.  # .o files needing special compilation flags
  190. @@ -141,6 +141,8 @@
  191.    ../include/history.h ../include/vars.h ../include/ircaux.h ../include/server.h \
  192.    ../include/screen.h ../include/window.h ../include/hold.h ../include/lastlog.h \
  193.    ../include/menu.h ../include/input.h ../include/names.h ../include/output.h 
  194. +color.o: color.c ../include/irc.h ../include/color.h ../include/vars.h \
  195. +  ../include/output.h
  196.  crypt.o: crypt.c ../include/irc.h ../include/defs.h ../include/config.h ../include/irc_std.h \
  197.    ../include/debug.h ../include/crypt.h ../include/vars.h ../include/ircaux.h \
  198.    ../include/list.h ../include/ctcp.h ../include/output.h 
  199. @@ -164,7 +166,8 @@
  200.    ../include/keys.h ../include/names.h ../include/alias.h ../include/history.h \
  201.    ../include/funny.h ../include/ctcp.h ../include/dcc.h ../include/translat.h \
  202.    ../include/output.h ../include/exec.h ../include/notify.h ../include/numbers.h \
  203. -  ../include/status.h ../include/if.h ../include/help.h ../include/stack.h ../include/queue.h 
  204. +  ../include/status.h ../include/if.h ../include/help.h ../include/stack.h \
  205. +  ../include/queue.h ../include/color.h
  206.  exec.o: exec.c ../include/irc.h ../include/defs.h ../include/config.h ../include/irc_std.h \
  207.    ../include/debug.h ../include/exec.h ../include/vars.h ../include/ircaux.h ../include/edit.h \
  208.    ../include/window.h ../include/hold.h ../include/lastlog.h ../include/menu.h \
  209. @@ -267,13 +270,14 @@
  210.    ../include/debug.h ../include/output.h ../include/vars.h ../include/input.h \
  211.    ../include/term.h ../include/lastlog.h ../include/window.h ../include/hold.h \
  212.    ../include/edit.h ../include/menu.h ../include/screen.h ../include/hook.h ../include/ctcp.h \
  213. -  ../include/log.h 
  214. +  ../include/log.h ../include/color.h
  215.  parse.o: parse.c ../include/irc.h ../include/defs.h ../include/config.h ../include/irc_std.h \
  216.    ../include/debug.h ../include/server.h ../include/names.h ../include/window.h \
  217.    ../include/hold.h ../include/lastlog.h ../include/edit.h ../include/menu.h ../include/vars.h \
  218.    ../include/ctcp.h ../include/hook.h ../include/ignore.h ../include/whois.h ../include/ircaux.h \
  219.    ../include/funny.h ../include/crypt.h ../include/term.h ../include/flood.h ../include/screen.h \
  220. -  ../include/output.h ../include/numbers.h ../include/parse.h ../include/notify.h 
  221. +  ../include/output.h ../include/numbers.h ../include/parse.h ../include/notify.h \
  222. +  ../include/color.h
  223.  queue.o: queue.c ../include/irc.h ../include/defs.h ../include/config.h ../include/irc_std.h \
  224.    ../include/debug.h ../include/alias.h ../include/ircaux.h ../include/output.h \
  225.    ../include/edit.h ../include/if.h ../include/queue.h 
  226. @@ -285,7 +289,7 @@
  227.    ../include/lastlog.h ../include/edit.h ../include/menu.h ../include/output.h \
  228.    ../include/vars.h ../include/server.h ../include/list.h ../include/term.h ../include/names.h \
  229.    ../include/ircaux.h ../include/input.h ../include/log.h ../include/hook.h ../include/dcc.h \
  230. -  ../include/translat.h ../include/exec.h 
  231. +  ../include/translat.h ../include/exec.h ../include/color.h
  232.  server.o: server.c ../include/irc.h ../include/defs.h ../include/config.h ../include/irc_std.h \
  233.    ../include/debug.h ../include/server.h ../include/ircaux.h ../include/whois.h \
  234.    ../include/lastlog.h ../include/exec.h ../include/window.h ../include/hold.h \
  235. @@ -299,7 +303,7 @@
  236.    ../include/vars.h ../include/hook.h ../include/input.h ../include/edit.h ../include/window.h \
  237.    ../include/hold.h ../include/lastlog.h ../include/menu.h ../include/screen.h \
  238.    ../include/mail.h ../include/output.h ../include/names.h ../include/ircaux.h \
  239. -  ../include/translat.h 
  240. +  ../include/translat.h ../include/color.h
  241.  term.o: term.c ../include/irc.h ../include/defs.h ../include/config.h ../include/irc_std.h \
  242.    ../include/debug.h ../include/term.h ../include/translat.h ../include/window.h \
  243.    ../include/hold.h ../include/lastlog.h ../include/edit.h ../include/menu.h ../include/screen.h 
  244. diff --unified --recursive --new-file ./source/color.c ../colirc/source/color.c
  245. --- ./source/color.c    Wed Dec 31 16:00:00 1969
  246. +++ ../colirc/source/color.c    Sun Dec 17 15:48:16 1995
  247. @@ -0,0 +1,310 @@
  248. +/* a color irc hack similar to circ, with some more features...
  249. + * since the source for circ was not found, this is completely from scratch
  250. + * bugs, ideas, and whatnot can be sent to escrafrd@oz.net <MadHacker on LinuxNet>
  251. + */
  252. +
  253. +#include "irc.h"
  254. +#include "output.h"
  255. +#include "vars.h"
  256. +#include "color.h"
  257. +
  258. +char rcolors[16]={0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1};
  259. +char colorstring[5];
  260. +name_color *nc_start = NULL;
  261. +name_color *nc_last = NULL;
  262. +
  263. +void
  264. +rcolorcmd(command, args, subargs)
  265. +        char    *command,
  266. +                *args,
  267. +                *subargs;
  268. +{
  269. +        char *arg;
  270. +        char colorstr[5];
  271. +        int x;
  272. +    int bright;
  273. +    int char_;
  274. +    char brightstr[]="bright ";
  275. +    char *selectstr[2]= {"deselected", "selected"};
  276. +    char rcolors_str[17];
  277. +
  278. +        while ((int)(arg = next_arg(args, &args)) != NULL)
  279. +    {
  280. +        bright=0;
  281. +        char_=1;
  282. +        brightstr[0] = 'b';
  283. +            if (arg[0] != '-' && arg[0] != '+')
  284. +        {
  285. +                        say("%s is a bad argument for /rcolor", arg);
  286. +                        continue;
  287. +        }
  288. +                if (!strcmp(arg, "-all"))
  289. +        {
  290. +                    for (x = 0; x < 16; x++)
  291. +                                rcolors[x] = 0;
  292. +            say("all colors deselected");
  293. +        }
  294. +                else if (!strcmp(arg, "+all"))
  295. +        {
  296. +                        for (x = 0; x < 16; x++)
  297. +                                rcolors[x] = 1;
  298. +            say("all colors selected");
  299. +        }
  300. +                else
  301. +        {
  302. +/*                        color_to_i(arg+1, colorstr);*/
  303. +            x = 0;
  304. +            do  {
  305. +            
  306. +                switch (tolower(arg[char_]))
  307. +                {
  308. +                     case 'b':
  309. +                        if (!strcmp(arg+char_, "black"))
  310. +                        {    
  311. +                            x = BLACK;
  312. +                        }
  313. +                        else if (!strcmp(arg+char_, "blue"))
  314. +                        {                
  315. +                            x = BLUE;
  316. +                        }
  317. +                        else if (!strcmp(arg+char_, "brown"))
  318. +                        {
  319. +                            x = BROWN;
  320. +                        }
  321. +                        else
  322. +                        {
  323. +                            bright = TRUE;
  324. +                            char_++; 
  325. +                        }
  326. +                        break;
  327. +                     case 'c':
  328. +                        x = CYAN;
  329. +                        break;
  330. +                     case 'g':
  331. +                        x = GREEN;
  332. +                        break;
  333. +                    case 'r':
  334. +                        x = RED;
  335. +                        break;
  336. +                    case 'p':
  337. +                        x = PURPLE;
  338. +                        break;
  339. +                    case 'w':
  340. +                        x = WHITE;
  341. +                        break;
  342. +                    default:
  343. +                        put_it("YOU DUMBASS, THAT'S NOT A COLOR");
  344. +                               return;
  345. +                }
  346. +            } while (bright && x == 0);
  347. +                        
  348. +            if (x == 0) return;
  349. +                        x -= BLACK;
  350. +                        if (bright) {x += 8;} 
  351. +            else brightstr[0] = '\0';
  352. +                        rcolors[x] = 0;
  353. +                        if (arg[0] == '+') rcolors[x] = 1;
  354. +            say("%s%s %s", brightstr, arg+char_, selectstr[rcolors[x]]);
  355. +        }
  356. +
  357. +    }
  358. +
  359. +}
  360. +
  361. +char *
  362. +tolower_str(string)
  363. +        char *string;
  364. +{
  365. +        char *lower_str;
  366. +        int x;
  367. +
  368. +        lower_str = (char *)new_malloc(strlen(string)+1);
  369. +        for (x = 0; x <= strlen(string); x++)
  370. +                lower_str[x] = tolower(string[x]);
  371. +        lower_str[x] = '\0';
  372. +        return lower_str;
  373. +}
  374. +void
  375. +colorcmd(command, args, subargs)
  376. +        char    *command,
  377. +                *args,
  378. +        *subargs;
  379. +{
  380. +    char *name, *color;
  381. +    char colorstr[5];
  382. +    name_color *nc;
  383. +    int bright;
  384. +    char brightstr[]="bright ";
  385. +        char *lower_name;
  386. +    int x;
  387. +    
  388. +    
  389. +    if (((int)(name = next_arg(args, &args)) != NULL) &&
  390. +        ((int)(color = next_arg(args, &args)) != NULL))
  391. +    {
  392. +        colorstr[0] = '\0';
  393. +        bright = 0;
  394. +        do  {
  395. +            
  396. +        switch (tolower(color[0]))
  397. +        {
  398. +             case 'b':
  399. +                if (!strcmp(color, "black"))
  400. +                {    
  401. +                    colorstr[0] = BLACK;
  402. +                }
  403. +                else if (!strcmp(color, "blue"))
  404. +                {                
  405. +                    colorstr[0] = BLUE;
  406. +                }
  407. +                else if (!strcmp(color, "brown"))
  408. +                {
  409. +                    colorstr[0] = BROWN;
  410. +                }
  411. +                else
  412. +                {
  413. +                    bright = TRUE;
  414. +                    color++; 
  415. +                }
  416. +                break;
  417. +             case 'c':
  418. +                colorstr[0] = CYAN;
  419. +                break;
  420. +             case 'g':
  421. +                colorstr[0] = GREEN;
  422. +                break;
  423. +            case 'r':
  424. +                colorstr[0] = RED;
  425. +                break;
  426. +            case 'p':
  427. +                colorstr[0] = PURPLE;
  428. +                break;
  429. +            case 'w':
  430. +                colorstr[0] = WHITE;
  431. +                break;
  432. +            default:
  433. +                put_it("YOU DUMBASS, THAT'S NOT A COLOR");
  434. +                       return;
  435. +        }
  436. +        } while (bright && colorstr[0] == '\0');
  437. +        colorstr[1] = '\0';
  438. +        if (bright)
  439. +        {
  440. +            colorstr[1] = BRIGHT;
  441. +            colorstr[2] = '\0';
  442. +        }
  443. +        if (nc = find_nc_name(name))
  444. +        {
  445. +            strcat(nc->colorstr, colorstr);
  446. +        }
  447. +        else 
  448. +        {
  449. +            nc = (name_color *) new_malloc(sizeof(name_color));
  450. +            nc->name = (char *) new_malloc(strlen(name)+1);
  451. +                lower_name = (char *) new_malloc(strlen(name)+1);
  452. +                for (x = 0; x <= strlen(name); x++)
  453. +                        lower_name[x] = tolower(name[x]);
  454. +            strcpy(nc->name, lower_name);
  455. +            new_free(&lower_name);
  456. +            strcpy(nc->colorstr, colorstr);
  457. +            if (nc_start == NULL) 
  458. +            {
  459. +                nc_start = nc;
  460. +                nc_last = nc;
  461. +                nc->next = NULL;
  462. +            }
  463. +            else 
  464. +            {                
  465. +                nc_last->next = nc;
  466. +                nc_last = nc;
  467. +                nc->next = NULL;
  468. +            }
  469. +        }
  470. +        if (bright) 
  471. +        {
  472. +            strcpy(brightstr, "bright ");
  473. +        }
  474. +        else brightstr[0] = '\0';
  475. +        say("%s is now %s%s", nc->name, brightstr, color);
  476. +    }
  477. +        else
  478. +    {
  479. +        say("Usage: /COLOR name color");
  480. +        say("colors: black red green brown blue purple cyan white");
  481. +        say("for bright colors prefix b to the color <bred for bright red, etc>");
  482. +    }
  483. +}
  484. +
  485. +char *
  486. +color_of(name)
  487. +    char *name;
  488. +{
  489. +    int i=0;
  490. +    name_color *nc;
  491. +    int x,y;
  492. +
  493. +    if (nc = find_nc_name(name))
  494. +    {
  495. +        return nc->colorstr;
  496. +    }
  497. +    else 
  498. +    {
  499. +/*        colorstring[i++]=(name[0]+name[1]) % 8 + BLACK;*/
  500. +        /* black foreground is a 'bad thing'(TM) ;) */
  501. +/*        if (colorstring[i-1] == BLACK) colorstring[i-1]++;
  502. +        if (((name[0]+name[1]) % 16) > 8) colorstring[i++]=BRIGHT;
  503. +        colorstring[i]='\0';
  504. +        return colorstring;*/
  505. +                /* count number of selected colors */
  506. +        for (x = 0, y = 0; x < 16; x++)
  507. +                        if (rcolors[x] == 1) y++;
  508. +                if (y == 0)
  509. +        {
  510. +                        colorstring[0] = WHITE;
  511. +                        colorstring[1] = '\0';
  512. +                        return colorstring;
  513. +        }
  514. +                i = (name[0]+name[1]) % y;
  515. +                i++;
  516. +                for (x = 0, y = 0; y < i; x++)
  517. +                    if (rcolors[x] == 1) y++;
  518. +            i = 0;
  519. +                x--;
  520. +                if (x < 8)
  521. +        {
  522. +                        colorstring[i++] = x + BLACK;
  523. +        }
  524. +                else
  525. +        {
  526. +                        colorstring[i++] = (x - 8) + BLACK;
  527. +                        colorstring[i++] = BRIGHT;
  528. +        }
  529. +        colorstring[i] = '\0';
  530. +                return colorstring;
  531. +    }
  532. +}
  533. +
  534. +name_color *
  535. +find_nc_name(name)
  536. +    char *name;
  537. +{
  538. +    name_color *nc;
  539. +    char *lower_name;
  540. +    int x;
  541. +    
  542. +    lower_name = (char *) new_malloc(strlen(name)+1);
  543. +    for (x = 0; x <= strlen(name); x++) 
  544. +        lower_name[x] = tolower(name[x]);
  545. +    for (nc = nc_start; nc != NULL; nc = nc->next)
  546. +    {
  547. +        if (!strcmp(nc->name, lower_name))
  548. +        {
  549. +            new_free(&lower_name);
  550. +            return nc;
  551. +        }
  552. +    }
  553. +    new_free(&lower_name);
  554. +    return NULL;
  555. +}
  556. +    
  557. diff --unified --recursive --new-file ./source/ctcp.c ../colirc/source/ctcp.c
  558. --- ./source/ctcp.c    Fri Jan  6 07:16:34 1995
  559. +++ ../colirc/source/ctcp.c    Sun Dec 17 17:34:37 1995
  560. @@ -34,6 +34,7 @@
  561.  #include "dcc.h"
  562.  #include "names.h"
  563.  #include "parse.h"
  564. +#include "color.h"
  565.  
  566.  #define    CTCP_SHUTUP    0
  567.  #define    CTCP_VERBOSE    1
  568. @@ -669,20 +670,24 @@
  569.          *to,
  570.          *cmd;
  571.  {
  572. +    char cline[3];
  573. +    
  574.      if (cmd && *cmd)
  575.      {
  576.          int old;
  577.  
  578.          old = set_lastlog_msg_level(LOG_ACTION);
  579. +        cline[0] = WHITE; cline[1] = '\0';
  580. +        if (get_int_var(COLORLINE_VAR)) strcpy(cline, color_of(from));
  581.          if (is_channel(to))
  582.          {
  583.              message_from(to, LOG_ACTION);
  584.              if (do_hook(ACTION_LIST, "%s %s %s", from, to, cmd))
  585.              {
  586.                  if (is_current_channel(to, 0))
  587. -                    put_it("* %s %s", from, cmd);
  588. +                    put_it("* %s%s %s%s%c ", color_of(from), from, cline, cmd, WHITE);
  589.                  else
  590. -                    put_it("* %s:%s %s", from, to, cmd);
  591. +                    put_it("* %s%s%c:%s%s %s%s%c ", color_of(from), from, WHITE, color_of(to), to, cline, cmd, WHITE);
  592.              }
  593.          }
  594.          else
  595. diff --unified --recursive --new-file ./source/edit.c ../colirc/source/edit.c
  596. --- ./source/edit.c    Mon Apr  3 07:48:21 1995
  597. +++ ../colirc/source/edit.c    Sun Dec 17 14:51:53 1995
  598. @@ -52,6 +52,7 @@
  599.  #include "help.h"
  600.  #include "stack.h"
  601.  #include "queue.h"
  602. +#include "color.h"
  603.  
  604.  /*
  605.   * current_exec_timer - used to make sure we don't remove a timer
  606. @@ -207,6 +208,8 @@
  607.      { "CD",        NULL,        cd,            0 },
  608.      { "CHANNEL",    "JOIN",        e_channel,        0 },
  609.      { "CLEAR",    NULL,        clear,            0 },
  610. +    { "COLOR",    NULL,        colorcmd,        0 },
  611. +    { "COLOUR",    NULL,        colorcmd,        0 },
  612.      { "COMMENT",    NULL,        comment,        0 },
  613.      { "CONNECT",    "CONNECT",    send_comm,        0 },
  614.      { "CTCC",    NULL,        dcc,            0 },
  615. @@ -269,6 +272,8 @@
  616.      { "QUIT",    "QUIT",        e_quit,            NONOVICEABBREV},
  617.      { "QUOTE",    NULL,        quote,            0 },
  618.      { "RBIND",    0,        rbindcmd,        0 },
  619. +    { "RCOLOR",    NULL,        rcolorcmd,        0 },
  620. +    { "RCOLOUR",    NULL,        rcolorcmd,        0 },
  621.      { "REDIRECT",    NULL,        redirect,        0 },
  622.      { "REHASH",    "REHASH",    send_comm,        0 },
  623.      { "REQUEST",    NULL,        ctcp,            0 },
  624. diff --unified --recursive --new-file ./source/names.c ../colirc/source/names.c
  625. --- ./source/names.c    Thu Apr  6 20:37:25 1995
  626. +++ ../colirc/source/names.c    Sun Dec 17 14:51:53 1995
  627. @@ -24,6 +24,7 @@
  628.  #include "lastlog.h"
  629.  #include "list.h"
  630.  #include "output.h"
  631. +#include "color.h"
  632.  
  633.  static    char    mode_str[] = "iklmnpst";
  634.  
  635. @@ -552,6 +553,7 @@
  636.  {
  637.      ChannelList *chan;
  638.      NickList *tmp;
  639. +    name_color *nc;
  640.  
  641.      for (chan = channel_list; chan; chan = chan->next)
  642.      {
  643. @@ -561,6 +563,11 @@
  644.              {
  645.                  new_free(&tmp->nick);
  646.                  malloc_strcpy(&tmp->nick, new_nick);
  647. +                if (nc = find_nc_name(old_nick))
  648. +                {
  649. +                    new_free(&nc->name);
  650. +                    nc->name = tolower_str(new_nick);
  651. +                }
  652.              }
  653.          }
  654.      }
  655. diff --unified --recursive --new-file ./source/output.c ../colirc/source/output.c
  656. --- ./source/output.c    Fri Jan  6 07:16:56 1995
  657. +++ ../colirc/source/output.c    Sun Dec 17 14:51:53 1995
  658. @@ -27,6 +27,7 @@
  659.  #include "hook.h"
  660.  #include "ctcp.h"
  661.  #include "log.h"
  662. +#include "color.h"
  663.  
  664.      int    in_help = 0;
  665.  
  666. @@ -159,14 +160,16 @@
  667.  #endif
  668.      if (window_display)
  669.      {
  670. -        putbuf[0] = putbuf[1] = putbuf[2] = '*';
  671. -        putbuf[3] = ' ';
  672. +        putbuf[0] = SAY_COLOR;
  673. +        putbuf[1] = putbuf[2] = putbuf[3] = '*';
  674. +        putbuf[4] = ' ';
  675. +        putbuf[5] = WHITE;
  676.  #ifdef USE_STDARG_H
  677.          va_start(vl, format);
  678. -        vsprintf(&putbuf[4], format, vl);
  679. +        vsprintf(&putbuf[6], format, vl);
  680.          va_end(vl);
  681.  #else
  682. -        sprintf(&putbuf[4], format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
  683. +        sprintf(&putbuf[6], format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
  684.  #endif
  685.          add_to_log(irclog_fp, putbuf);
  686.          add_to_screen(putbuf);
  687. diff --unified --recursive --new-file ./source/parse.c ../colirc/source/parse.c
  688. --- ./source/parse.c    Sun Jan 15 22:22:55 1995
  689. +++ ../colirc/source/parse.c    Sun Dec 17 17:45:41 1995
  690. @@ -35,6 +35,7 @@
  691.  #include "numbers.h"
  692.  #include "parse.h"
  693.  #include "notify.h"
  694. +#include "color.h"
  695.  
  696.  #define STRING_CHANNEL '+'
  697.  #define MULTI_CHANNEL '#'
  698. @@ -437,12 +438,16 @@
  699.          *to;
  700.      char    *high;
  701.      int    no_flood;
  702. +    char    bwhite[]= {WHITE, BRIGHT, '\0'};
  703. +    char    cline[3];
  704.  
  705.  if (!from)
  706.          return;
  707.      PasteArgs(Args, 1);
  708.      to = Args[0];
  709.      ptr = Args[1];
  710. +    cline[0] = WHITE; cline[1] = '\0';
  711. +    if (get_int_var(COLORLINE_VAR)) strcpy(cline, color_of(from));
  712.      if (!to || !ptr)
  713.          return;
  714.      if (is_channel(to))
  715. @@ -549,15 +554,14 @@
  716.              doing_privmsg = 1;
  717.              if (no_flood && do_hook(list_type, "%s %s %s", from, 
  718.                  to, ptr))
  719. -                put_it("%s<%s>%s %s", high, from, high, ptr);
  720. +                put_it("%s<%s%s%s> %s%s%c ", bwhite, color_of(from), from, bwhite, cline, ptr, WHITE);
  721.              doing_privmsg = 0;
  722.              break;
  723.          case PUBLIC_OTHER_LIST:
  724.              doing_privmsg = 1;
  725.              if (no_flood && do_hook(list_type, "%s %s %s", from,
  726.                  to, ptr))
  727. -                put_it("%s<%s:%s>%s %s", high, from, to, high,
  728. -                    ptr);
  729. +                put_it("%s<%s%s%s:%s%s%s> %s%s%c ", bwhite, color_of(from), from, bwhite, color_of(to), to, bwhite, cline, ptr, WHITE);
  730.              doing_privmsg = 0;
  731.              break;
  732.          }
  733. diff --unified --recursive --new-file ./source/screen.c ../colirc/source/screen.c
  734. --- ./source/screen.c    Mon Apr  3 07:48:28 1995
  735. +++ ../colirc/source/screen.c    Sun Dec 17 14:51:54 1995
  736. @@ -35,6 +35,7 @@
  737.  #include "dcc.h"
  738.  #include "translat.h"
  739.  #include "exec.h"
  740. +#include "color.h"
  741.  
  742.      Window    *to_window;
  743.      Screen    *current_screen;
  744. @@ -440,7 +441,17 @@
  745.      {
  746.          switch (*ptr)
  747.          {
  748. +        case BLACK:
  749. +        case BLUE:
  750. +        case GREEN:
  751. +        case CYAN:
  752. +        case RED:
  753. +        case PURPLE:
  754. +        case BROWN:
  755. +        case WHITE:
  756. +        case BRIGHT:
  757.          case REV_TOG:
  758. +            
  759.          case UND_TOG:
  760.          case BOLD_TOG:
  761.          case ALL_OFF:
  762. @@ -510,6 +521,16 @@
  763.                  bold = display_bold(TOGGLE);
  764.                  bold = 1 - bold;
  765.              }
  766. +                        if (*ptr >= BLACK && *ptr <= WHITE)
  767. +                        {
  768. +                                fflush(current_screen->fpout);
  769. +                                fprintf(current_screen->fpout, "\e[0;3%dm", *ptr - BLACK);
  770. +                        }
  771. +                        if (*ptr == BRIGHT)
  772. +                        {
  773. +                                fflush(current_screen->fpout);
  774. +                                fprintf(current_screen->fpout, "\e[1m");
  775. +                        }
  776.              str = ++ptr;
  777.              break;
  778.          case '\007':
  779. @@ -1146,6 +1167,16 @@
  780.                  buffer[pos++] = *ptr;
  781.                  col++;
  782.                  break;
  783. +            case BLACK:
  784. +            case BLUE:
  785. +            case GREEN:
  786. +            case CYAN:
  787. +            case RED:
  788. +            case PURPLE:
  789. +            case BROWN:
  790. +            case WHITE:
  791. +            case BRIGHT:
  792. +                
  793.              case UND_TOG:
  794.              case ALL_OFF:
  795.              case REV_TOG:
  796. diff --unified --recursive --new-file ./source/status.c ../colirc/source/status.c
  797. --- ./source/status.c    Mon Apr  3 07:48:30 1995
  798. +++ ../colirc/source/status.c    Sun Dec 17 14:51:54 1995
  799. @@ -28,6 +28,7 @@
  800.  #include "names.h"
  801.  #include "ircaux.h"
  802.  #include "translat.h"
  803. +#include "color.h"
  804.  
  805.  extern    time_t    time();
  806.  
  807. @@ -603,7 +604,8 @@
  808.              {
  809.                  RJustifyPos = i;
  810.              }
  811. -            else if (buffer[i] != REV_TOG && buffer[i] != UND_TOG && buffer[i] != ALL_OFF && buffer[i] != BOLD_TOG)
  812. +            else if (buffer[i] != REV_TOG && buffer[i] != UND_TOG && buffer[i] != ALL_OFF && buffer[i] != BOLD_TOG
  813. +                 && (buffer[i] < BLACK || buffer[i] > WHITE) && buffer[i] != BRIGHT)
  814.              {
  815.                  if (RealPosition == CO)
  816.                  {
  817. @@ -662,7 +664,8 @@
  818.              {
  819.                  if (buffer[i] != window->status_line[i])
  820.                      break;
  821. -                if (buffer[i] != REV_TOG && buffer[i] != UND_TOG && buffer[i] != ALL_OFF && buffer[i] != BOLD_TOG)
  822. +                if (buffer[i] != REV_TOG && buffer[i] != UND_TOG && buffer[i] != ALL_OFF && buffer[i] != BOLD_TOG
  823. +                    && (buffer[i] < BLACK || buffer[i] > WHITE) && buffer[i] != BRIGHT)
  824.                      RealPosition++;
  825.              }
  826.          }
  827. @@ -1209,6 +1212,16 @@
  828.          {
  829.              switch(*s)
  830.              {
  831. +            case BLACK:
  832. +            case BLUE:
  833. +            case GREEN:
  834. +            case CYAN:
  835. +            case RED:
  836. +            case PURPLE:
  837. +            case BROWN:
  838. +            case WHITE:
  839. +            case BRIGHT:
  840. +                
  841.              case UND_TOG:
  842.              case ALL_OFF:
  843.              case REV_TOG:
  844. diff --unified --recursive --new-file ./source/vars.c ../colirc/source/vars.c
  845. --- ./source/vars.c    Wed Jan  4 22:39:56 1995
  846. +++ ../colirc/source/vars.c    Sun Dec 17 14:51:54 1995
  847. @@ -89,7 +89,8 @@
  848.      { "CLOCK_24HOUR",        BOOL_TYPE_VAR,    DEFAULT_CLOCK_24HOUR, NULL, reset_clock, 0, 0 },
  849.      { "CLOCK_ALARM",        STR_TYPE_VAR,    0, NULL, set_alarm, 0, 0 },
  850.      { "CMDCHARS",            STR_TYPE_VAR,    0, NULL, NULL, 0, 0 },
  851. -    { "COMMAND_MODE",        BOOL_TYPE_VAR,    DEFAULT_COMMAND_MODE, NULL, NULL, 0, 0 },
  852. +    { "COLORLINE",                  BOOL_TYPE_VAR,  DEFAULT_COLORLINE, NULL, NULL, 0, 0 },
  853. +           { "COMMAND_MODE",        BOOL_TYPE_VAR,    DEFAULT_COMMAND_MODE, NULL, NULL, 0, 0 },
  854.      { "CONTINUED_LINE",        STR_TYPE_VAR,    0, NULL, set_continued_line, 0, 0 },
  855.      { "DCC_BLOCK_SIZE",        INT_TYPE_VAR,    DEFAULT_DCC_BLOCK_SIZE, NULL, NULL, 0, 0 },
  856.      { "DEBUG",            INT_TYPE_VAR,    0, NULL, NULL, 0, 0 },
  857.